<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="yinq">
<title>文件管理</title>
<link rel="stylesheet" href="{{cdn}}/static/v5/css/materialdesignicons.min.css">
<link rel="stylesheet" href="{{cdn}}/static/v5/css/bootstrap.min.css">
<link rel="stylesheet" href="{{cdn}}/static/v5/css/animate.min.css">
<link rel="stylesheet" href="{{cdn}}/static/v5/js/jquery-confirm/jquery-confirm.min.css">
<link rel="stylesheet" href="{{cdn}}/static/v5/js/bootstrap-table/bootstrap-table.min.css">
<link rel="stylesheet" href="{{cdn}}/static/v5/css/style.min.css">
<link href="{{cdn}}/static/codemirror/lib/codemirror.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/addon/hint/show-hint.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/monokai.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/eclipse.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/ambiance.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/3024-day.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/dracula.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/darcula.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/gruvbox-dark.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/material.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/material-darker.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/material-palenight.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/nord.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/oceanic-next.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/panda-syntax.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/paraiso-dark.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/paraiso-light.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/shadowfox.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/solarized.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/the-matrix.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/tomorrow-night-bright.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/xq-dark.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/xq-light.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/yeti.css" rel="stylesheet">
<link href="{{cdn}}/static/codemirror/theme/zenburn.css" rel="stylesheet">
<style>
  .CodeMirror {
      height: 100%;
  }
  .icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
  }
  .card-body {
    height: 100vh;
    overflow-y: auto;
  }
  /* 修复CodeMirror自动补全下拉框被模态框遮挡的问题 */
  .CodeMirror-hints {
    z-index: 9999 !important;
  }
  .CodeMirror-hint {
    z-index: 9999 !important;
  }
</style>
</head>
<body>
<div class="container-fluid">
  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <header class="card-header">
          <div class="card-title">文件管理</div>
        </header>
        <div class="card-body">
          <div hidden id="path">{{ path }}</div>
          <div>
            当前目录：<a href="javascript:void(0);" onclick="changeDirectory('')">根目录</a>
            {% for url1,x in url %}
              {% if x =='' %}
                <a href="javascript:void(0);" onclick="changeDirectory('{{ url1 }}')"></a>
              {% else %}
                <a href="javascript:void(0);" onclick="changeDirectory('{{ url1 }}')">/{{ x }}</a>
              {% endif %}
            {% endfor %}
            
            <button style="float: right; margin-left:10px;" class="btn btn-sm btn-success" onclick="shuaxin()" title="刷新"><i class="mdi mdi-restore"></i></button>
            <button class="btn btn-warning dropdown-toggle btn-sm" style="float: right; margin-left:10px;" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">文件操作</button>
            <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
              <li><a class="dropdown-item" onclick="CreateFile()">新建文件</a></li>
              <li><a class="dropdown-item" onclick="CreateDir()">新建目录</a></li>
              <li><a class="dropdown-item" onclick="upload()">上传文件</a></li>
            </ul>
            <span id="select_single_line"></span>
                  <span id="shear"></span>
          </div>
          <table id="table"></table>
          
        </div>
      </div>
    </div>
  </div>
</div>
<div class="modal fade" id="newsModal">
  <div class="modal-dialog modal-xl">
    <div class="modal-content">
      <div class="modal-header">
        <h6 class="modal-title"><span>文件</span></h6>
        <div class="float-end">
          --切换主题配色--
          <select id="select" onchange="selectTheme()">
            <option>monokai</option>
            <option>eclipse</option>
            <option>ambiance</option>
            <option>3024-day</option>
            <option>default</option>
            <option>dracula</option>
            <option>darcula</option>
            <option>gruvbox-dark</option>
            <option>material</option>
            <option>material-darker</option>
            <option>material-palenight</option>
            <option>nord</option>
            <option>oceanic-next</option>
            <option>panda-syntax</option>
            <option>paraiso-dark</option>
            <option>paraiso-light</option>
            <option>shadowfox</option>
            <option>solarized</option>
            <option>the-matrix</option>
            <option>tomorrow-night-bright</option>
            <option>xq-dark</option>
            <option>xq-light</option>
            <option>yeti</option>
            <option>zenburn</option>
          </select>
        </div>
      </div>
      <div class="modal-body">
        <div class="row">
          <div class="mb-3 col-md-12">
            <div style="height: 700px;">
              <textarea id="myTextarea"></textarea>
            </div>
          </div>
        </div>
      </div>
      <div class="modal-footer">
        <input type="hidden" name="id" id="news_id" value="" />
        <button type="submit" class="btn btn-primary save-btn btn-sm" onclick="saveFile()">保存</button>
        <button type="button" class="btn btn-secondary close-btn btn-sm" data-bs-dismiss="modal" aria-label="Close">关闭</button>
      </div>
    </div>
  </div>
</div>
<script src="{{cdn}}/static/v5/js/jquery.min.js"></script>
<script src="{{cdn}}/static/v5/js/popper.min.js"></script>
<script src="{{cdn}}/static/v5/js/bootstrap.min.js"></script>
<script src="{{cdn}}/static/v5/js/bootstrap-notify.min.js"></script>
<script src="{{cdn}}/static/v5/js/jquery-confirm/jquery-confirm.min.js"></script>
<script src="{{cdn}}/static/v5/js/bootstrap-table/bootstrap-table.js"></script>
<script src="{{cdn}}/static/v5/js/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>

<!-- CodeMirror 核心文件 -->
<script src="{{cdn}}/static/codemirror/lib/codemirror.js"></script>
<!-- CodeMirror 自动补全功能 -->
<script src="{{cdn}}/static/codemirror/addon/hint/show-hint.js"></script>
<script src="{{cdn}}/static/codemirror/addon/hint/anyword-hint.js"></script>
<script src="{{cdn}}/static/codemirror/addon/hint/javascript-hint.js"></script>
<script src="{{cdn}}/static/codemirror/addon/hint/html-hint.js"></script>
<script src="{{cdn}}/static/codemirror/addon/hint/css-hint.js"></script>
<script src="{{cdn}}/static/codemirror/addon/hint/xml-hint.js"></script>
<script src="{{cdn}}/static/codemirror/addon/hint/sql-hint.js"></script>
<!-- CodeMirror 语言模式支持 -->
<script src="{{cdn}}/static/codemirror/mode/clike/clike.js"></script>
<script src="{{cdn}}/static/codemirror/mode/php/php.js"></script>
<script src="{{cdn}}/static/codemirror/mode/javascript/javascript.js"></script>
<script src="{{cdn}}/static/codemirror/mode/python/python.js"></script>
<script src="{{cdn}}/static/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<script src="{{cdn}}/static/codemirror/mode/css/css.js"></script>
<script src="{{cdn}}/static/codemirror/mode/xml/xml.js"></script>
<script src="{{cdn}}/static/codemirror/mode/sql/sql.js"></script>
<script src="{{cdn}}/static/codemirror/mode/markdown/markdown.js"></script>
<script src="{{cdn}}/static/codemirror/mode/yaml/yaml.js"></script>
<script src="{{cdn}}/static/codemirror/mode/shell/shell.js"></script>
<script src="{{cdn}}/static/codemirror/mode/go/go.js"></script>
<script src="{{cdn}}/static/codemirror/mode/ruby/ruby.js"></script>
<script src="{{cdn}}/static/codemirror/mode/perl/perl.js"></script>
<script src="{{cdn}}/static/codemirror/mode/clike/clike.js"></script>


<!-- 页面功能脚本 -->
<script src="{{cdn}}/static/v5/example/js/layer/layer.js"></script>
<script src="{{cdn}}/static/js/fife.js"></script>
<script src="{{cdn}}/static/js/iconfont.js"></script>
</body>
</html>
